import 'package:flutter/material.dart';
import '../../../widgets/common_image.dart';
import 'function_button_data.dart';

class FuntionButtonWidget extends StatelessWidget {
  final FunctionButtonItem data;
  const FuntionButtonWidget(this.data, { Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        if (null != data.onTapHandle) {
          data.onTapHandle(context);
        }
      },
      child: Container(
        width: MediaQuery.of(context).size.width * 0.33,
        padding: EdgeInsets.only(top: 30.0),
        child: Column(
          children: [
            CommonImage(data.imageUrl),
            Text(data.title)
          ],
        ),
      ),
    );
  }
}